/** 
 * File-Name:WeiboUserInfoAction.java
 *
 * Created on 2011-11-11 下午09:52:05
 * 
 * @author: Neo (neolimeng@gmail.com)
 * Software Engineering Institute, Peking University, China
 * 
 * Copyright (c) 2009, Peking University
 * 
 *
 */
package site.web;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;

import neoutil.CommonAction;
import neoutil.Page;
import site.entity.WeiboUserInfo;
import site.service.WeiboUserInfoRepository;

/**
 * Description:
 * 
 * @author: Neo (neolimeng@gmail.com) Software Engineering Institute, Peking
 *          University, China
 * @version 1.0 2011-11-11 下午09:52:05
 */
public class WeiboUserInfoAction extends CommonAction {
	private WeiboUserInfo weiboUserInfo;
	private Page<WeiboUserInfo> page = new Page<WeiboUserInfo>(15);

	public String addWeiboUserInfo() {
		try {
			WeiboUserInfoRepository.save(weiboUserInfo);
			return SUCCESS;
		} catch (Exception e) {
			e.printStackTrace();
			return INPUT;
		}
	}

	public String deleteWeiboUserInfo() {
		try {
			Long id = Long.parseLong(getRequestParameter("id"));
			WeiboUserInfoRepository.delete(id);
			return SUCCESS;
		} catch (Exception e) {
			e.printStackTrace();
			return INPUT;
		}
	}

	public String getAllWeiboUsers() {
		try {
			page = WeiboUserInfoRepository.getAll(page);
			return SUCCESS;
		} catch (Exception e) {
			e.printStackTrace();
			return INPUT;
		}

	}

	public WeiboUserInfo getWeiboUserInfo() {
		return weiboUserInfo;
	}

	public void setWeiboUserInfo(WeiboUserInfo weiboUserInfo) {
		this.weiboUserInfo = weiboUserInfo;
	}

	public Page<WeiboUserInfo> getPage() {
		return page;
	}

	public void setPage(Page<WeiboUserInfo> page) {
		this.page = page;
	}
}
